package com.mg.controller;

import com.github.pagehelper.PageInfo;
import com.mg.dto.PowerAccountDto;
import com.mg.dto.SimpleResult;
import com.mg.model.PowerAccount;
import com.mg.service.PowerAccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by mg1213 on 2018/3/18.
 */
@Controller
@RequestMapping("/powerAccount")
public class PowerAccountController {
    @Autowired
    private PowerAccountService powerAccountService;

    @RequestMapping(value = "/admin/selectPageInfo")
    @ResponseBody
    public PageInfo<PowerAccountDto> selectPageInfo(PowerAccountDto dto, int limit, int start) {
        return powerAccountService.selectPageInfo(dto, start, limit);
    }
    @RequestMapping(value = "/admin/insertPowerAccount")
    @ResponseBody
    public SimpleResult insertPowerAccount(PowerAccount record) {
        return powerAccountService.insertPowerAccount(record);
    }
    @RequestMapping(value = "/admin/updatePowerAccount")
    @ResponseBody
    public SimpleResult updatePowerAccount(PowerAccount record) {
        return powerAccountService.updatePowerAccount(record);
    }
    @RequestMapping(value = "/admin/deletePowerAccount")
    @ResponseBody
    public SimpleResult deletePowerAccount(String ids) {
        return powerAccountService.deletePowerAccount(ids);
    }

}
